#include <iostream>
#include <cstring>

using namespace std;

const int MOD = 1e6 + 7, N = 110;
int x[N];
int f[N];
int main()
{
	f[0] = 1;
	int n, m; cin >> n >> m;
	for (int i = 1; i <= n; i++)cin >> x[i];
	int ret = 0;
	for (int i = 1; i <= n; i++)
		for (int j = m; j >= 0; j--)
		{
			for (int k = 1; k <= min(x[i], j); k++)
				f[j] = (f[j] + f[j - k]) % MOD;
		}
			
	cout << f[m] << endl;
	return 0;
}


